/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package doan.quanlycanbo.portlet.model;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

/**
 * @author Nguyen Tuan Vinh
 */
public class xuatthanClp extends BaseModelImpl<xuatthan> implements xuatthan {
	public xuatthanClp() {
	}

	public long getPrimaryKey() {
		return _maxuatthan;
	}

	public void setPrimaryKey(long pk) {
		setMaxuatthan(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_maxuatthan);
	}

	public long getMaxuatthan() {
		return _maxuatthan;
	}

	public void setMaxuatthan(long maxuatthan) {
		_maxuatthan = maxuatthan;
	}

	public long getGroupId() {
		return _groupId;
	}

	public void setGroupId(long groupId) {
		_groupId = groupId;
	}

	public long getCompanyId() {
		return _companyId;
	}

	public void setCompanyId(long companyId) {
		_companyId = companyId;
	}

	public String getLanguageId() {
		return _languageId;
	}

	public void setLanguageId(String languageId) {
		_languageId = languageId;
	}

	public String getTenxuatthan() {
		return _tenxuatthan;
	}

	public void setTenxuatthan(String tenxuatthan) {
		_tenxuatthan = tenxuatthan;
	}

	public xuatthan toEscapedModel() {
		if (isEscapedModel()) {
			return this;
		}
		else {
			return (xuatthan)Proxy.newProxyInstance(xuatthan.class.getClassLoader(),
				new Class[] { xuatthan.class }, new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		xuatthanClp clone = new xuatthanClp();

		clone.setMaxuatthan(getMaxuatthan());
		clone.setGroupId(getGroupId());
		clone.setCompanyId(getCompanyId());
		clone.setLanguageId(getLanguageId());
		clone.setTenxuatthan(getTenxuatthan());

		return clone;
	}

	public int compareTo(xuatthan xuatthan) {
		int value = 0;

		value = getTenxuatthan().compareTo(xuatthan.getTenxuatthan());

		value = value * -1;

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		xuatthanClp xuatthan = null;

		try {
			xuatthan = (xuatthanClp)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long pk = xuatthan.getPrimaryKey();

		if (getPrimaryKey() == pk) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return (int)getPrimaryKey();
	}

	public String toString() {
		StringBundler sb = new StringBundler(11);

		sb.append("{maxuatthan=");
		sb.append(getMaxuatthan());
		sb.append(", groupId=");
		sb.append(getGroupId());
		sb.append(", companyId=");
		sb.append(getCompanyId());
		sb.append(", languageId=");
		sb.append(getLanguageId());
		sb.append(", tenxuatthan=");
		sb.append(getTenxuatthan());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(19);

		sb.append("<model><model-name>");
		sb.append("doan.quanlycanbo.portlet.model.xuatthan");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>maxuatthan</column-name><column-value><![CDATA[");
		sb.append(getMaxuatthan());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>groupId</column-name><column-value><![CDATA[");
		sb.append(getGroupId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>companyId</column-name><column-value><![CDATA[");
		sb.append(getCompanyId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>languageId</column-name><column-value><![CDATA[");
		sb.append(getLanguageId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>tenxuatthan</column-name><column-value><![CDATA[");
		sb.append(getTenxuatthan());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private long _maxuatthan;
	private long _groupId;
	private long _companyId;
	private String _languageId;
	private String _tenxuatthan;
}